import { createStore } from 'vuex'

// 创建一个新的 store 实例
const store = createStore({
    state: {
        name: '牧马城市',
        background: '#000',
        allunread: 0,
        appunread: 0,
    },
    mutations: {
        changeMusic(state, value) {
            state.name = value
        },
        changeBackground(state, value) {
            state.background = value
        },
        changeAllunread(state, value) {
            state.allunread = value
        },
        changeAppunread(state, value) {
            state.appunread = localStorage.getItem('appunread')
        }
    },
    getters: {
        music(state) {
            return state.name
        }
    },
})


export default store